<extend name="Public:base" />

<block name="content">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><em class="glyphicon glyphicon-th-list"></em> 
            {$type}         
            </h3>
        </div>
        
    </div>

    <div class="row margin-botton">
        <div class="col-sm-6 column">
            <div class="btn-group btn-group-md">
                <if condition='ACTION_NAME eq "index"'>
                    <button class="btn btn-primary" type="button" onclick="doGoBatch('{:U('backup')}')"><em class="glyphicon glyphicon-plus-sign"></em> 数据库备份</button>
                    <button class="btn btn-default" type="button" onclick="doGoBatch('{:U('optimize', array('batchFlag' => 1))}')"><em class="glyphicon glyphicon-th-list"></em> 数据表优化</button>
                    <button class="btn btn-default" type="button" onclick="doGoBatch('{:U('repair', array('batchFlag' => 1))}')"><em class="glyphicon glyphicon-th-list"></em> 数据表修复</button>
                    <button class="btn btn-default" type="button" onclick="goUrl('{:U('restore')}')"><em class="glyphicon glyphicon-th-list"></em> 还原管理</button>
                <else/>
                    <button class="btn btn-primary" type="button" onclick="goUrl('{:U('index')}')"><em class="glyphicon glyphicon-plus-sign"></em> 返回</button>
                    <button class="btn btn-default" type="button" onclick="doGoBatch('{:U('restore')}')"><em class="glyphicon glyphicon-th-list"></em> 还原</button>
                    <button class="btn btn-default" type="button" onclick="doConfirmBatch('{:U('clear')}', '确实要彻底删除选择项吗？')"><em class="glyphicon glyphicon-th-list"></em> 删除</button>
                </if>

            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="alert alert-warning" role="alert">
              <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
              <span class="sr-only">Note:</span>
              数据库中共有{$tableNum}张表，共计{$total}
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <form action="" method="post" id="form_do" name="form_do">
                <div class="table-responsive">
                    <table class="table table-hover xyh-table-bordered-out">
                        <thead>
                            <tr class="active">
                                <th><input type="checkbox" id="check"></th>
                                <th>表名</th>
                                <th>表用途</th>
                                <th>记录行数</th>
                                <th>引擎</th>
                                <th>字符集</th>
                                <th>表大小</th>
                                <th class="text-right">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <foreach name='vlist' item='v'>
                        <tr>
                            <td><input type="checkbox" name="key[]" value="{$v.name}"></td>
                            <td class="aleft">{$v.name}</td>
                            <td>{$v.comment}</td>
                            <td>{$v.rows}</td>
                            <td>{$v.engine}</td>
                            <td>{$v.collation}</td>
                            <td>{$v.size}</td>
                            <td class="text-right">
                                <a href="{:U('optimize',array('tablename' => $v['name']), '')}" class="label label-info">优化</a>
                                <a href="{:U('repair',array('tablename' => $v['name']), '')}" class="label label-success">修复</a>                          
                            </td>
                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </form>
            
        </div>
    </div>

    </block>